package com.longcai.piaojia.conn;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONObject;

/**
 * Created by Administrator on 2016/10/14.
 */
@HttpInlet(Conn.ORDER_OBTAINBALANCE)
public class GetBalanceGet extends BaseAsyGet<GetBalanceGet.BalanceEntity> {

    public String user_id, type_id;

    public GetBalanceGet(AsyCallBack<BalanceEntity> asyCallBack) {
        super(asyCallBack);
    }

    @Override
    protected BalanceEntity parser(JSONObject object) throws Exception {

        if(object.optInt("code")==200){

            BalanceEntity balanceEntity = new BalanceEntity();
            balanceEntity.privilege = object.optString("privilege");
            balanceEntity.wallet = object.optString("wallet");

            return balanceEntity;

        }

        TOAST = object.optString("message");

        return null;
    }

    public static class BalanceEntity{

        public String privilege, wallet;

    }

}
